﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Vkontakte.Api.Operations
{
	[ApiMethod("places.getCountries")]
	public sealed class PlacesGetCountries
		:Base30ApiOperation
	{
		private Country[] _countries;

		public PlacesGetCountries()
		{
			
		}

		protected override void Compile()
		{
			AddParameter("method", "places.getCountries");
			if (NeedFull)
			{
				AddParameter("need_full","1");
			}
			base.Compile();
		}

		protected override void ParseData(string data)
		{
			ListingResponce responce = Serializer.LoadObjectXmlString<ListingResponce>(data);
			_countries = responce.Countries;
			base.ParseData(data);
		}

		public bool NeedFull
		{
			get; set;
		}

		public Country[] GetResult()
		{
			return _countries;
		}
	}
}
